package com.example.demo;


import com.example.demo.util.BaseRepositoryImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import java.net.InetAddress;

//声明该类是一个spring boot的引导类
//作用：标注在某个类上说明这个类史SpringBoot的主配置类，SpringBoot就应该运行这个类的main方法来启动SpringBoot应用
@SpringBootApplication

@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class)
public class DemoApplication {

    private static final Logger log = LoggerFactory.getLogger(DemoApplication.class);

    // main是Java程序的入口
    public static void main(String[] args) {
        // run方法 表示运行spring boot的引导类 run参数就是spring boot引导类的字节码对象
        SpringApplication.run(DemoApplication.class, args);
        log.info("\n-----------------------启动成功-----------------------------------\n\t" +
                        "Application is running! Access URLs:\n\t" +
                        "swagger: \t\thttp://localhost:8080/swagger-ui.html#/\n\t" +
                        "druid: \t\thttp://localhost:8080/druid/index.html\n\t" +
                        "Profile(s): \t{}\n------------------------------");
    }
}
